//
// Created by lovep on 2025/4/25.
//

#ifndef BITREE_H
#define BITREE_H



#include "defination.h"


typedef struct BiTNode //结点结构
{
    TElemType data; //数据域
    struct BiTNode *lchild, *rchild; //左孩子域和右孩子域
} BiTNode, *BiTree;

Status BiTree_Create(BiTree &T);
BiTree BiTree_PICreate(char PreOrder[], char InOrder[], int PreIndex, int InIndex, int count);
BiTree BiTree_IPCreate(char InOrder[], char PostOrder[], int InIndex, int PostIndex, int count);
Status BiTree_Copy(BiTree T1, BiTree &T2);
int BiTree_PreCompare(BiTree T1, BiTree T2);
Status BiTree_PrePrint(BiTree T);
Status BiTree_InPrint(BiTree T);
Status BiTree_PostPrint(BiTree T);
Status BiTree_CountNode(BiTree T, int &num);
Status BiTree_CountLeafNode(BiTree T, int &num);
int BiTree_Depth(BiTree T);
BiTree BiTree_SearchNode(BiTree T, TElemType data, char path[], int count = -1, char symbol = '\0');

#endif //BITREE_H
